﻿@model OrderModel.AddOrderProductModel.ProductDetailsModel

@if (Model.IsRental)
{
    //Actually just a copy (almost) of \Presentation\SDF.Web\Views\Product\_RentalInfo.cshtml
    <div class="panel panel-default">
        <div class="panel-body">
            @{
                const string startDateControlId = "rental_start_date";
                const string endDateControlId = "rental_end_date";
                //currenly we support only this format
                const string datePickerFormat = "mm/dd/yy";

                <div class="form-group">
                    <div class="col-md-3">
                        <span class="required">*</span>
                        <div class="label-wrapper">
                            <label class="control-label">
                                @T("Products.RentalStartDate")
                            </label>
                        </div>
                    </div>
                    <div class="col-md-9">
                        <input id="@(startDateControlId)" name="@(startDateControlId)" type="text" class="form-control"/>
                        <script>
                            $(document).ready(function() {
                                $("#@(startDateControlId)").datepicker({ dateFormat: "@datePickerFormat" });
                            });
                        </script>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3">
                        <span class="required">*</span>
                        <div class="label-wrapper">
                            <label class="control-label">
                                @T("Products.RentalEndDate")
                            </label>
                        </div>
                    </div>
                    <div class="col-md-9">
                        <input id="@(endDateControlId)" name="@(endDateControlId)" type="text" class="form-control"/>
                        <script>
                            $(document).ready(function() {
                                $("#@(endDateControlId)").datepicker({ dateFormat: "@datePickerFormat" });
                            });
                        </script>
                    </div>
                </div>
            }
        </div>
    </div>
}
